package com.example.heizhu.appfuncore.deeplinkdemo;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.example.heizhu.appfuncore.R;

import core.android.deeplinks.deeplinking.AKDeeplink;
import core.android.tools.AK;

public class DeepLinkTestActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        AK.d();
        AKDeeplink.INSTANCE.initDeeplinking(getApplication());

        findViewById(R.id.test1).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                go();
            }
        });
        findViewById(R.id.test2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                html5();
            }
        });
    }

    private void go() {
        AKDeeplink.INSTANCE.openURL("http://www.http.com/products/88?referrer=baa.com");
    }
    private void html5() {
        AKDeeplink.INSTANCE.openURL("http://www.http.com/html5?url=https://www.sogou.com/&referrer=baidu.com");
    }
}
